﻿CREATE TABLE [dbo].[DBFees] (
    [ID]							UNIQUEIDENTIFIER DEFAULT (newid()) NOT NULL,
    [Broker]						VARCHAR (50)     NOT NULL,
    [isPercentageFees]				BIT	             DEFAULT (NULL) NULL,
    [IntradayInitialMargin]			FLOAT            DEFAULT (NULL) NULL,
    [IntradayMaintenanceMargin]		FLOAT            DEFAULT (NULL) NULL,
    [OvernightInitialMargin]		FLOAT            DEFAULT (NULL) NULL,
    [OvernightMaintenanceMargin]	FLOAT            DEFAULT (NULL) NULL,
    [ExecFees]						FLOAT            DEFAULT (NULL) NULL,
    [MinExecFee]					FLOAT            DEFAULT (NULL) NULL,
    [ModifyFees]					FLOAT            DEFAULT (NULL) NULL,
    [CancelFees]					FLOAT            DEFAULT (NULL) NULL,
    [Borrow]						FLOAT            DEFAULT (NULL) NULL,
    [Lend]							FLOAT            DEFAULT (NULL) NULL,
    [Crncy]							VARCHAR(3)       DEFAULT (NULL) NULL,
    [InstrumentID]					UNIQUEIDENTIFIER NULL,
    PRIMARY KEY CLUSTERED ([ID] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF),
    /*UNIQUE NONCLUSTERED ([InstrumentID] ASC, [Broker] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF),*/
    FOREIGN KEY ([InstrumentID]) REFERENCES [dbo].[DBInstruments] ([ID]) ON DELETE CASCADE ON UPDATE NO ACTION
);
